import time,json,re

com1=["hello,let's begin", "test"]
com2=("hello,let's begin", "test")

users={"admin":com1,"visitor":com2}

comment = [
    "hello,let's begin", "test"
]

def add_ellipsis():
    for i in comment:
        if len(i)>10:
            i=i[:10]+"..."
            print(i)
        else:
            print(i)

add_ellipsis()

print("".center(60,"*"))

def ellipsis(name):
    com=[]
    for i in users[name]:
        if len(i)>10:
            i=i[:10]+"..."
            com.append(i)
        else:
            com.append(i)
    return com
    

def Diss():

    com=[]
    flag=True
    count=0
    while flag:
        name=str(input("please input username: "))
        if name in users.keys():
            print("Welcome to the Fortum")
            print("".center(60,"-"))
            for i in ellipsis(name):
                print(name,' :\n',"".join(repr(i)))
        elif count==3:
            print(" More than 3 times,it will be exited ")
            flag=False
            break
        else:
            print("it's error,please input again.")
            count=count+1
            continue

Diss()

"""
不考虑用户登录步骤
是对评论进行操作
"""